package com.training.content.service.impl;

import java.util.List;
import com.training.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.training.content.mapper.AssessItemMapper;
import com.training.content.domain.AssessItem;
import com.training.content.service.IAssessItemService;

/**
 * 考核内容Service业务层处理
 * 
 * @author training
 * @date 2021-10-25
 */
@Service
public class AssessItemServiceImpl implements IAssessItemService 
{
    @Autowired
    private AssessItemMapper assessItemMapper;

    /**
     * 查询考核内容
     * 
     * @param itemId 考核内容主键
     * @return 考核内容
     */
    @Override
    public AssessItem selectAssessItemByItemId(Long itemId)
    {
        return assessItemMapper.selectAssessItemByItemId(itemId);
    }

    /**
     * 查询考核内容列表
     * 
     * @param assessItem 考核内容
     * @return 考核内容
     */
    @Override
    public List<AssessItem> selectAssessItemList(AssessItem assessItem)
    {
        return assessItemMapper.selectAssessItemList(assessItem);
    }

    /**
     * 新增考核内容
     * 
     * @param assessItem 考核内容
     * @return 结果
     */
    @Override
    public int insertAssessItem(AssessItem assessItem)
    {
        assessItem.setCreateTime(DateUtils.getNowDate());
        return assessItemMapper.insertAssessItem(assessItem);
    }

    /**
     * 修改考核内容
     * 
     * @param assessItem 考核内容
     * @return 结果
     */
    @Override
    public int updateAssessItem(AssessItem assessItem)
    {
        assessItem.setUpdateTime(DateUtils.getNowDate());
        return assessItemMapper.updateAssessItem(assessItem);
    }

    /**
     * 批量删除考核内容
     * 
     * @param itemIds 需要删除的考核内容主键
     * @return 结果
     */
    @Override
    public int deleteAssessItemByItemIds(Long[] itemIds)
    {
        return assessItemMapper.deleteAssessItemByItemIds(itemIds);
    }

    /**
     * 删除考核内容信息
     * 
     * @param itemId 考核内容主键
     * @return 结果
     */
    @Override
    public int deleteAssessItemByItemId(Long itemId)
    {
        return assessItemMapper.deleteAssessItemByItemId(itemId);
    }
}
